import { Map } from "immutable";
import * as types from './constans';
const ininState = Map({
    topList: [],
    songsList: [],
    titleInfo: {}
})

const reducer = (state = ininState, actions) => {
    switch (actions.type) {
        case types.CHANGE_TOP_LIST:
            return state.set('topList', actions.list)
        case types.CHANGE_SONGS_LIST:
            return state.set('songsList', actions.list);
        case types.CHANGE_TITLE_INFO:
            return state.set('titleInfo', actions.info)
        default:
            return state
    }
}
export default reducer